var o = getApp();

Page({
    data: {
        ticket: {},
        color: "",
        kFootshow: !0
    },
    onLoad: function(o) {
        this.getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    tabrshowbtn: function(o) {
        console.log(o), o.detail && this.setData({
            kFootshow: !1
        });
    },
    getColor: function(o) {
        switch (o) {
          case "Color010":
            this.setData({
                color: "#63B359"
            });
            break;

          case "Color020":
            this.setData({
                color: "#2C9F67"
            });
            break;

          case "Color030":
            this.setData({
                color: "#509FC9"
            });
            break;

          case "Color040":
            this.setData({
                color: "#5885CF"
            });
            break;

          case "Color050":
            this.setData({
                color: "#9062C0"
            });
            break;

          case "Color060":
            this.setData({
                color: "#D09A45"
            });
            break;

          case "Color070":
            this.setData({
                color: "#E4B138"
            });
            break;

          case "Color080":
            this.setData({
                color: "#EE903C"
            });
            break;

          case "Color090":
            this.setData({
                color: "#DD6549"
            });
            break;

          case "Color100":
            this.setData({
                color: "#CC463D"
            });
        }
    },
    getData: function() {
        var t = this, a = o.getNetAddresss("plugin.wx-card-ticket.frontend.controllers.sign.getTicket");
        o._postNetWork({
            url: a,
            data: {},
            success: function(o) {
                var a = o.data;
                1 == a.result ? (t.setData({
                    ticket: a.data.ticket
                }), t.data.ticket.color && t.getColor(t.data.ticket.color)) : (wx.showToast({
                    title: a.msg,
                    icon: "none"
                }), console.log(a.msg));
            }
        });
    },
    getType: function() {
        var t = o.getNetAddresss("plugin.wx-card-ticket.frontend.controllers.sign.wxJsSdkConfig");
        o._postNetWork({
            url: t,
            data: {},
            success: function(o) {
                var t = o.data;
                1 == t.result ? wx.addCard({
                    cardList: t.data.cardPackage,
                    success: function(o) {
                        console.log(o.cardList);
                    }
                }) : (wx.showToast({
                    title: t.msg,
                    icon: "none"
                }), console.log(t.msg));
            }
        });
    }
});